﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="HangHoaManagerForm.aspx.cs" Inherits="WebShoes.Admin.HangHoaManagerForm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="panel-heading">    
    <h3 class="panel-title">
    <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
    <b>Danh Sách Hàng Hóa</b>
    </h3>
    </div>
<div class="panel-body">
    <a class="btn btn-primary" href="HangHoaForm.aspx">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Thêm mới
    </a>
    </br></br>
    <div class="form-group">
        <label for="inputEmail3" class="col-sm-2">Dữ liệu cần tìm</label>
        <div class="col-sm-4">
            <asp:DropDownList ID="ddlChon" runat="server" CssClass="form-control" 
                onselectedindexchanged="ddlChon_SelectedIndexChanged" AutoPostBack="True">
                <asp:ListItem Value="0">--Chọn loại dữ liệu tìm kiếm--</asp:ListItem>
                <asp:ListItem Value="1">Mã hàng hóa</asp:ListItem>
                <asp:ListItem Value="2">Tên hàng hóa</asp:ListItem>
                <asp:ListItem Value="3">Chủng Loại</asp:ListItem>
                <asp:ListItem Value="4">Nhà sản xuất</asp:ListItem>
                <asp:ListItem Value="5">Loại hàng hóa</asp:ListItem>
            </asp:DropDownList>
            
        </div>
        <div class="col-sm-4">
            <asp:TextBox ID="txtNhap" runat="server" placeholder="Nhập dữ liệu cần tìm" CssClass="form-control"></asp:TextBox>
            <asp:DropDownList ID="ddlSearch" runat="server" CssClass="form-control" 
                onselectedindexchanged="ddlSearch_SelectedIndexChanged">
                
            </asp:DropDownList>
        </div>        
        <div class="col-sm-2">
        <asp:LinkButton ID="btnTimKiem" runat="server" CssClass="btn btn-primary" 
                onclick="btnTimKiem_Click">
                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>Tìm Kiếm</asp:LinkButton>
        </div>
    </div>    
    </br></br>
    <b><asp:Label ID="lblThongBao" runat="server" ForeColor="Red"></asp:Label>
    <asp:GridView ID="GridView1" runat="server" CssClass="table table-hover" 
        AutoGenerateColumns="False" BorderStyle="None" GridLines="None" 
        HorizontalAlign="Center" AllowPaging="True" 
        onpageindexchanging="GridView1_PageIndexChanging" PageSize="5" 
        onrowcommand="GridView1_RowCommand">
        <Columns>
            <asp:TemplateField HeaderText="Hình Ảnh">
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("HinhAnh") %>' 
                        Width="70px" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("HinhAnh") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="MaHangHoa" HeaderText="Mã" />
            <asp:BoundField DataField="TenHangHoa" HeaderText="Tên Hàng Hóa" />
            <asp:BoundField DataField="TenNhaSanXuat" HeaderText="Hãng" />
            <asp:BoundField DataField="TenChungLoai" HeaderText="Chủng Loại" />
            <asp:BoundField DataField="TenLoaiHangHoa" HeaderText="Loại Hàng Hóa" />
            <asp:TemplateField HeaderText="#">
                
                <ItemTemplate>
                    <asp:LinkButton ID="btnDelete" runat="server" 
                        CommandArgument='<%# Eval("MaHangHoa") %>' CommandName="cmdDelete" 
                        OnClientClick="return confirm('Bạn có muốn xóa mặt hàng này không?');" 
                        CssClass="btn btn-warning">
                        <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Xóa
                        </asp:LinkButton> 
                    <asp:HyperLink ID="HyperLink1" runat="server" CssClass="btn btn-danger"
                        NavigateUrl='<%# "HangHoaForm.aspx?MaHangHoa=" + Eval("MaHangHoa") %>'>
                        <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Sửa
                        </asp:HyperLink>
                </ItemTemplate>
                <ItemStyle CssClass="col-action" />

            </asp:TemplateField>
        </Columns>
        
        <PagerSettings PageButtonCount="5" />
        
        <PagerStyle CssClass="~/css/style.css pagination-ys" />
        
    </asp:GridView>
    </b>



</div>

</asp:Content>
